#ifndef SERVERTCP_H
#define SERVERTCP_H

#include <QWidget>
#include <QTcpServer>
#include <QTcpSocket>
#include <QMap>

namespace Ui {
class ServerTcp;
}

class ServerTcp : public QWidget
{
    Q_OBJECT

public:
    explicit ServerTcp(QWidget *parent = 0);
    ~ServerTcp();

private slots:
    void on_stratBt_clicked();

    void new_client();
    void read_data();
private:
    Ui::ServerTcp *ui;
    //创建一个服务器对象
    QTcpServer mserver;
    //id 套接字
    QMap<QString,QTcpSocket *>clients;


};

#endif // SERVERTCP_H
